############################ -*- Mode: Makefile -*- ###########################
## Makefile.in --
## ITIID           : $ITI$ $Header $__Header$
## Author          : Ulrich Pfeifer
## Created On      : Tue Mar  8 14:40:27 1994
## Last Modified By: Ulrich Pfeifer
## Last Modified On: Thu Dec 22 15:52:55 1994
## Update Count    : 139
## Status          : Unknown, Use with caution!
###############################################################################
prefix = /usr/local/wais
exec_prefix = $(prefix) 
VPATH = @srcdir@
CFLAGS = -I. @CFLAGS@

           srcdir = @srcdir@
      CURRENT_DIR = $(srcdir) 
               CC = @CC@
               RM = rm -f
           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
          INSTALL = @INSTALL@
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
     INSTALL_DATA = @INSTALL_DATA@
           bindir = $(exec_prefix)/bin
           libdir = $(exec_prefix)/lib
           mandir = $(prefix)/man/man1
           manext = 1
          SUBDIRS = @SUBDIRS@ lib ir ui x @TESTDIR@

          SCRIPTS = \
                    check-sources  \
                    getaddrs \
                    index.mail \
                    server_stats \
                    start.myserver \
                    swais.sh \
                    wais-gif-display \
                    wais-html-display \
                    wais-jfif-display \
                    wais-jpeg-display \
                    wais-pict-display \
                    wais-ppm-display \
                    wais-tiff-display \
                    waisretrieve \
                    ws

          MANUALS = \
                     waisindex \
                     waisq \
                     waissearch \
                     waisserver \
                     xwais \
                     xwaisq 


all:: config.status config.h

$(bindir):
	$(srcdir)/mkinstalldirs $(bindir)

$(libdir):
	$(srcdir)/mkinstalldirs $(libdir)

$(mandir):
	$(srcdir)/mkinstalldirs $(mandir)

install:: $(bindir) $(mandir) 
	for script in $(SCRIPTS)   ;  do \
	$(INSTALL_PROGRAM)  bin/$${script}.script $(bindir)/$(binprefix)$${script}; \
	done
	for man in $(MANUALS)  ; do \
	$(INSTALL_DATA) doc/original-TM-wais/manl/$${man}.man \
		$(mandir)/$${man}.$(manext) ; \
	done
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \
	$(MAKE) $(MFLAGS) install); \
	done

config.h: config
	./config >config.h

config: config.o
	$(RM) $@
	$(CC) -o $@ config.o $(LDOPTIONS)  $(LDLIBS)  $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) config

clean::
	$(RM) config config.o

all::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "making" all "in $(CURRENT_DIR)/$$i..."; \
	$(MAKE) $(MFLAGS) all); \
	done

config.status: configure
	sh $(srcdir)/configure
	touch config.status
	touch Install.tmpl Defaults.tmpl

Install.tmpl Defaults.tmpl: config.status Install.tmpl.in Defaults.tmpl.in
	sh ./config.status
	touch Install.tmpl Defaults.tmpl

veryclean:: clean
	$(RM) config.status # Install.tmpl Defaults.tmpl
	$(RM) ./doc/SF/freeWAIS-sf.dvi ./doc/SF/freeWAIS-sf.ps

veryclean::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo verb "in $(CURRENT_DIR)/$$i..."; \
	$(MAKE) $(MFLAGS) veryclean ); \
	done

depend::
	$(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)


# -------------------------------------------------------------------------
# common rules for all Makefiles - do not edit

emptyrule::

clean::
	$(RM_CMD) "#"*

Makefile::
	-@if [ -f Makefile ]; then set -x; \
	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
	else exit 0; fi
	$(IMAKE_CMD) -DTOPDIR = @DTOPDIR@

tags::
	$(TAGS) -w *.[ch]
	$(TAGS) -xw *.[ch] > TAGS

saber:
	# load $(ALLDEFINES) $(SRCS)

osaber:
	# load $(ALLDEFINES) $(OBJS)

# -------------------------------------------------------------------------
# rules for building in SUBDIRS - do not edit


clean::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "cleaning" "in $(CURRENT_DIR)/$$i..."; \
	$(MAKE) $(MFLAGS) clean ) ; \
	done

tags::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "tagging" "in $(CURRENT_DIR)/$$i..."; \
	$(MAKE) $(MFLAGS) tags ); \
	done


includes::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo including "in $(CURRENT_DIR)/$$i..."; \
	$(MAKE) $(MFLAGS)  includes); \
	done

